package com.ssy.lingxi.purchase.api.enums.tender;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 招标内部操作枚举类型
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/29
 */
public enum InviteTenderInOperationEnum {

    New_Invite_Tender(1, "新增招标"),
    Submit_Check_Invite_Tender(2, "提交审核招标"),
    Check_Invite_Tender(3, "审核招标"),
    Platform_Check_Invite_Tender(4, "平台审核招标"),
    Submit_Invite_Tender(5, "提交招标"),
    Check_Register(6, "审核报名"),
    Qualifications_Check(7, "资格审核"),
    Finish_Selection_Tender(8, "专家评标"),
    Submitted_Selection_Tender(9, "提交评标报告"),
    Selection_Win(10, "选择中标会员"),
    Submit_Check_Finish_Tender(11, "提交审核定标"),
    Check_Finish_Tender(12, "审核定标"),
    Confirm_Invite_Tender(13, "确认定标"),
    Send_Win_Notice(14, "发送中标公示"),
    Finish_Invite_Tender(15, "完成招标"),
    Discard_Tender(16, "已废标");

    private Integer code;
    private String message;

    InviteTenderInOperationEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code){
        InviteTenderInOperationEnum statusEnum = Arrays.stream(InviteTenderInOperationEnum.values()).filter(v -> v.getCode().equals(code)).findAny().orElse(null);
        return null == statusEnum ? "" : LanguageHolder.getName(InviteTenderInOperationEnum.class, statusEnum.getCode());
    }
}
